package com.xyz;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by sunny on 2016/12/18.
 */
@RestController
public class HelloController {
    //读取yml配置文件里面的数据
    @Value("${server.name}")
    private String name;

    @Value("${age}")
    private int age;

    @RequestMapping(method = RequestMethod.GET, value = "hello")
    private String say() {
        return name + age;
    }
}
